/**
 * @description =>zy
 */
import Cookies from 'js-cookie'
import storage from './storage'

const TokenKey = 'token',
      tokenCookieExpires = 1;

/*Cookies save*/
export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token, rememberMe) {
  if (rememberMe) {
    return Cookies.set(TokenKey, token, { expires: tokenCookieExpires })
  } else return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}



export function getAccount() {
  return storage.get('addAccount')
}

export function setAccount(userId) {
  return storage.set('addAccount', userId)
}

export function removeAccount() {
  return storage.remove('addAccount')
}